package com.fish.anne.model;

import com.fish.anne.model.BaseObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="system_nav" )
public class SystemNav extends BaseObject implements Serializable {
    private Long navId;
    private short cid;
    private String ctype;
    private String navName;
    private String navPosition;
    private boolean openNewOn;
    private boolean showOn;
    private byte showOrder;
    private String url;

    @Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getNavId() {
        return this.navId;
    }
    
    public void setNavId(Long navId) {
        this.navId = navId;
    }
    
    @Column(name="cid", nullable=false)
    public short getCid() {
        return this.cid;
    }
    
    public void setCid(short cid) {
        this.cid = cid;
    }
    
    @Column(name="ctype", nullable=false, length=10)
    public String getCtype() {
        return this.ctype;
    }
    
    public void setCtype(String ctype) {
        this.ctype = ctype;
    }
    
    @Column(name="nav_name", nullable=false)
    public String getNavName() {
        return this.navName;
    }
    
    public void setNavName(String navName) {
        this.navName = navName;
    }
    
    @Column(name="nav_position", nullable=false, length=10)
    public String getNavPosition() {
        return this.navPosition;
    }
    
    public void setNavPosition(String navPosition) {
        this.navPosition = navPosition;
    }
    
    @Column(name="open_new_on", nullable=false)
    public boolean isOpenNewOn() {
        return this.openNewOn;
    }
    
    public void setOpenNewOn(boolean openNewOn) {
        this.openNewOn = openNewOn;
    }
    
    @Column(name="show_on", nullable=false)
    public boolean isShowOn() {
        return this.showOn;
    }
    
    public void setShowOn(boolean showOn) {
        this.showOn = showOn;
    }
    
    @Column(name="show_order", nullable=false)
    public byte getShowOrder() {
        return this.showOrder;
    }
    
    public void setShowOrder(byte showOrder) {
        this.showOrder = showOrder;
    }
    
    @Column(name="url", nullable=false)
    public String getUrl() {
        return this.url;
    }
    
    public void setUrl(String url) {
        this.url = url;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SystemNav pojo = (SystemNav) o;

         if (ctype != null ? !ctype.equals(pojo.ctype) : pojo.ctype != null) return false;
        if (navName != null ? !navName.equals(pojo.navName) : pojo.navName != null) return false;
        if (navPosition != null ? !navPosition.equals(pojo.navPosition) : pojo.navPosition != null) return false;
        if (openNewOn != pojo.openNewOn) return false;
        if (showOn != pojo.showOn) return false;
         if (url != null ? !url.equals(pojo.url) : pojo.url != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
         result = 31 * result + (ctype != null ? ctype.hashCode() : 0);
        result = 31 * result + (navName != null ? navName.hashCode() : 0);
        result = 31 * result + (navPosition != null ? navPosition.hashCode() : 0);
        result = 31 * result + (openNewOn ? 1 : 0);
        result = 31 * result + (showOn ? 1 : 0);
         result = 31 * result + (url != null ? url.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("navId").append("='").append(getNavId()).append("', ");
        sb.append("cid").append("='").append(getCid()).append("', ");
        sb.append("ctype").append("='").append(getCtype()).append("', ");
        sb.append("navName").append("='").append(getNavName()).append("', ");
        sb.append("navPosition").append("='").append(getNavPosition()).append("', ");
        sb.append("openNewOn").append("='").append(isOpenNewOn()).append("', ");
        sb.append("showOn").append("='").append(isShowOn()).append("', ");
        sb.append("showOrder").append("='").append(getShowOrder()).append("', ");
        sb.append("url").append("='").append(getUrl()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
